<template>
	<uv-empty :mode="props.mode" :text="props.text" :textColor="props.textColor" :icon="computedSrc"></uv-empty>

</template>
<script setup lang="ts"> 
	import { computed } from 'vue';
	import { EmptyEnum } from '@/core/enum';
	import { cdnFilesUrl } from '@/core/consts';

	const props = withDefaults(defineProps<{
		mode : EmptyEnum;
		text : string;
		textColor : string;
	}>(), {
		mode: EmptyEnum.data,
		text: '数据为空',
		textColor: '#c0c4cc'
	})

	const computedSrc = computed(() => {
		let src = '';
		switch (props.mode) {
			case EmptyEnum.data:
				src = '/static/images/empty/data.png';
				break;
			case EmptyEnum.address:
				src = '/static/images/empty/address.png';
				break;
			case EmptyEnum.authority:
				src = '/static/images/empty/authority.png';
				break;
			case EmptyEnum.cart:
				src = '/static/images/empty/cart.png';
				break;
			case EmptyEnum.collect:
				src = '/static/images/empty/collect.png';
				break;
			case EmptyEnum.comment:
				src = '/static/images/empty/comment.png';
				break;
			case EmptyEnum.coupon:
				src = '/static/images/empty/coupon.png';
				break;
			case EmptyEnum.history:
				src = '/static/images/empty/history.png';
				break;
			case EmptyEnum.message:
				src = '/static/images/empty/message.png';
				break;
			case EmptyEnum.messageList:
				src = '/static/images/empty/messageList.png';
				break;
			case EmptyEnum.news:
				src = '/static/images/empty/news.png';
				break;
			case EmptyEnum.order:
				src = '/static/images/empty/order.png';
				break;
			case EmptyEnum.search:
				src = '/static/images/empty/search.png';
				break;
			case EmptyEnum.wifi:
				src = '/static/images/empty/wifi.png';
				break;
			case EmptyEnum.page:
				src = '/static/images/empty/page.png';
				break;
			default:
				src = '/static/images/empty/data.png';
				break;
		}
		return cdnFilesUrl + src;
	})
</script>
<style lang="scss" scoped></style>